package com.itheima.web.task;

import com.itheima.domain.db.AnalysisByDay;
import com.itheima.service.db.AnalysisService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * 定时任务 统计 日志分析表
 */
@Component
public class AnalysisJob {

    @DubboReference
    private AnalysisService analysisService;
    //TODO 上线的时候记得修改时间
    //@Scheduled(cron = "* * 0/1 * * *") //每小时执行一次
    @Scheduled(cron = "0/5 * * * * *") //每小时执行一次
    public void run(){
        System.out.println("定时读取任务开始");
        analysisService.logToAnalysisByDay();//开始日志分析
    }
}
